using Config;
using Entity.Monster.State;
using MoonFramework.Scripts.Pool;
using MoonFramework.Scripts.Tool.System.Setting;
using Tool.Name;

namespace Entity.Monster
{
    public class Boar : Monster
    {
        public override void Init(ActorViewController viewController)
        {
            base.Init(viewController);
            
            //初始化Config
            ActorConfig = ConfigManager.Instance.GetConfig<MonsterConfig>(ConfigName.Monster, nameof(Boar));
            MonsterConfig = (MonsterConfig)ActorConfig;
            
            //初始化动画
            viewController._AttackAnimation = AnimationConfig.BoarAttack;
            viewController._IdleAnimation = AnimationConfig.BoarIdle;
            viewController._RunAnimation = AnimationConfig.BoarRun;
            viewController._DeadAnimation = AnimationConfig.BoarDead;
            viewController._WalkAnimation = AnimationConfig.BoarWalk;
            viewController._HurtAnimation = AnimationConfig.BoarHurt;
            
            fsmMachine = ObjPoolManager.Instance.Pop(()=> new MonsterFsm(), 
                res=> res.Init(nameof(MonsterIdleState), this));
        }
    }
}